#pragma once

#include "IRenderer.h"
#include "d3d9.h"

class TestCamera;

class RenderableFactoryImp
	: public ChunkSystem::IRenderableFactory
{
public:
	virtual ChunkSystem::IRenderable* Create( ChunkSystem::ChunkItem* pChunkItem );
};

class D3DRenderer
	:public ChunkSystem::IRenderer /*, ChunkSystem::IChunkSpaceEventListener*/
{
public:
	D3DRenderer(LPDIRECT3DDEVICE9 pD3DDevice,TestCamera* pCamera);
	virtual ~D3DRenderer(void);

	//IRenderer
	virtual ChunkSystem::IRenderableFactory* GetRenderableFactory( void );
	virtual bool Draw();

	//IChunkSpaceEventListner
	//virtual void OnAddIdenticalChunk(ChunkSystem::Chunk* pChunk);
	//virtual void OnRemoveChunk(ChunkSystem::Chunk* pChunk);

	//Own
	LPDIRECT3DDEVICE9 GetD3DDevice(void);

private:
	
	LPDIRECT3DDEVICE9					m_pDevice;
	TestCamera*							m_pCamera;

	ChunkSystem::IRenderableFactory*	m_pMeshFactory;
};
